//
//  YRJSearchResultDestinationTableViewCell.m
//  YanRenjie
//
//  Created by dllo on 15/11/4.
//  Copyright (c) 2015年 yanrenjie. All rights reserved.
//

#import "YRJSearchResultDestinationTableViewCell.h"
#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height

@implementation YRJSearchResultDestinationTableViewCell
- (void)dealloc {
    [_photoImageView release];
    [_cnnameLabel release];
    [_ennameLabel release];
    [_beenStrLabel release];
    [_parentnameLabel release];
    [_labelLabel release];
    
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell {
    self.photoImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.photoImageView];
    [_photoImageView release];
    
    self.cnnameLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.cnnameLabel];
    [_cnnameLabel release];
    self.cnnameLabel.font = [UIFont systemFontOfSize:14];
    
    self.parentnameLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.parentnameLabel];
    [_parentnameLabel release];
    self.parentnameLabel.font = [UIFont systemFontOfSize:12];
    
    self.ennameLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.ennameLabel];
    [_ennameLabel release];
    self.ennameLabel.font = [UIFont systemFontOfSize:12];
    
    self.labelLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.labelLabel];
    [_labelLabel release];
    
    self.beenStrLabel= [[UILabel alloc] init];
    [self.contentView addSubview:self.beenStrLabel];
    [_beenStrLabel release];
    self.beenStrLabel.font = [UIFont systemFontOfSize:10];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.photoImageView.frame = CGRectMake(10, 5, (WIDTH - 20) / 3, HEIGHT - 10);
    self.cnnameLabel.frame = CGRectMake(WIDTH / 3 + 15, 5, WIDTH / 2, (HEIGHT - 10) / 3);
    self.ennameLabel.frame = CGRectMake(WIDTH / 3 + 15, 5 + (HEIGHT - 10) / 3, WIDTH / 2, (HEIGHT - 10) / 3);
    self.beenStrLabel.frame = CGRectMake(WIDTH / 3 + 15, 5 + (HEIGHT - 10) / 3 * 2, WIDTH / 2, (HEIGHT - 10) / 3);
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
